package com.wyvoid.forum.dao.hibernate;

import com.wyvoid.core.persistent.Pagination;
import com.wyvoid.core.persistent.hibernate.HibernateDAO;
import com.wyvoid.core.persistent.hibernate.HibernatePage;
import com.wyvoid.forum.domain.Stat;
import com.wyvoid.forum.dao.IStatDAO;

/**
 * 统计信息Hibernate数据处理实现
 *
 * @author wyvoid
 * @version $Revision: 1.8 $ $Date: 2006/06/19 07:58:11 $
 * @link www.wyvoid.com
 */
public class StatDAO extends HibernateDAO<Stat> implements IStatDAO {

    /**
     * 查找全部的统计信息
     *
     * @param field      检索字段
     * @param value      检索匹配的值
     * @param pagination 分页对象
     * @return QueryResult 日志集合
     */
    public HibernatePage<Stat> findStats(String field, String value, Pagination pagination) {
        String hql="from Stat where "+field+" like ?";
        return doQuery(hql,true,pagination,"%"+value+"%");
    }


    /**
     * 删除全部的统计信息
     */
    public void deleteAllStat() {
        super.executeHsql("delete from Stat");
	}
	
}